#include<iostream>
#include<ctime>

#define OK 0
#define DEBUG 1
#define INFO  2
#define ERROR 3
#define LOG(level,format, ...){\
        time_t t = time(nullptr);\
        struct tm* ptm = localtime(&t);\
        char str_time[32];\
        strftime(str_time,31,"%H:%M:%S",ptm);\
        const char* level_str[4] = {"OK","DEBUG","INFO","ERROR"};\
        printf("[%s] [%s] [%s:%d] " format "\n",level_str[level],str_time,__FILE__,__LINE__,##__VA_ARGS__);\
    }

#define LOG_DEBUG(format,...) LOG(DEBUG,format,##__VA_ARGS__)
#define LOG_INFO(format,...) LOG(INFO,format,##__VA_ARGS__)
#define LOG_ERROR(format,...) LOG(ERROR,format,##__VA_ARGS__)

int main(){
    LOG_DEBUG("hello")
    LOG_INFO("HELLO");
    LOG_ERROR("ERROR");
    return 0;
}

// int main(){
//     time_t t = time(nullptr);
//     struct tm* ptm = localtime(&t);
//     char str_time[32];
//     strftime(str_time,31,"%H:%M:%S",ptm);
//     printf("[%s],[%s:%d]\n",str_time,__FILE__,__LINE__);
//     return 0;
// }